package com.xjtu.project.controller.user;

import com.xjtu.project.common.utls.JsonResponse;
import com.xjtu.project.model.domain.Employee;
import com.xjtu.project.model.domain.User;
import com.xjtu.project.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/user")
public class UserUserController {
    @Autowired
    private UserService userService;

    @PostMapping("login")
    public JsonResponse login(@RequestBody User user) {
        User login = userService.login(user);
        return JsonResponse.success(login);
    }
}
